package interview.multithread;

public class ExtendsThread {
    public static void main(String[] args) {
        new Mythread().start();
        new Mythread().start();
        new Mythread().start();
    }
}


class Mythread extends Thread{
    private int ticket = 5;

    @Override
    public void run(){
        for (int i = 0; i < 10; i++) {
            if (ticket>0){
                System.out.println(this+"-车票第"+ticket--+"张");
            }
        }
    }
}
